package com.proj.service.impl;

import com.proj.bean.Cart;
import com.proj.bean.Useraddress;
import com.proj.dao.CartDao;
import com.proj.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements ICartService {

    @Autowired
    private CartDao cartDao;

    @Override
    public int add(Cart cart) {
        return cartDao.add(cart);
    }

    @Override
    public int subtract(Cart cart) {
        return cartDao.subtract(cart);
    }

    @Override
    public int del(Cart cart) {
        return cartDao.del(cart);
    }

    @Override
    public int getCount(Cart cart) {
        return cartDao.getCount(cart);
    }

    @Override
    public List<Cart> getList(int userid) {
        return cartDao.getList(userid);
    }

    @Override
    public List<Useraddress> getUserAddress(int userid) {
        return cartDao.getUserAddress(userid);
    }

    @Override
    public int cartgoodsstate(int userid, int goodsid) {
        return cartDao.cartgoodsstate(userid, goodsid);
    }


}
